package com.example.a20;

import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MyRequestMappingHandlerAdapter extends RequestMappingHandlerAdapter {

    /**
     * 重写 调用 RequestMapping 处理程序方法
     *
     * @param request       HTTP请求对象，包含请求数据
     * @param response      HTTP响应对象，用于向客户端发送响应数据
     * @param handlerMethod 处理请求的方法对象
     * @return ModelAndView对象，包含模型数据和视图信息
     * @throws Exception 如果在执行过程中发生错误，抛出异常
     */
    @Override
    public ModelAndView invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {
        return super.invokeHandlerMethod(request, response, handlerMethod);
    }
}
